package com.shu.logsearch;

import com.github.pagehelper.PageHelper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.Properties;

/**
 * 参考@link https://github.com/panholly/esfilesearch
 * 使用 Elasticsearch7.1.1
 */
@SpringBootApplication
public class LogsearchApplication {

    public static void main(String[] args) {
        SpringApplication.run(LogsearchApplication.class, args);
    }


    /**
     * 配置mybatis的分页插件pageHelper
     */
    @Bean
    public PageHelper pageHelper() {
        PageHelper pageHelper = new PageHelper();
        Properties props = new Properties();
        props.setProperty("dialect", "sqlite");
        // 表示支持从接口中读取pageNum和pageSize
        props.setProperty("supportMethodsArguments", "true");
        pageHelper.setProperties(props);
        return pageHelper;
    }

}
